go_library(
    name = "remote",
    srcs = glob(
        ["*.go"],
        exclude = ["*_test.go"],
    ),
    pgo_file = "//:pgo",
    visibility = ["PUBLIC"],
    deps = [
        "///third_party/go/cloud.google.com_go_longrunning//autogen/longrunningpb",
        "///third_party/go/github.com_alessio_shellescape//:shellescape",
        "///third_party/go/github.com_bazelbuild_remote-apis-sdks//go/pkg/client",
        "///third_party/go/github.com_bazelbuild_remote-apis-sdks//go/pkg/command",
        "///third_party/go/github.com_bazelbuild_remote-apis-sdks//go/pkg/digest",
        "///third_party/go/github.com_bazelbuild_remote-apis-sdks//go/pkg/filemetadata",
        "///third_party/go/github.com_bazelbuild_remote-apis-sdks//go/pkg/retry",
        "///third_party/go/github.com_bazelbuild_remote-apis-sdks//go/pkg/uploadinfo",
        "///third_party/go/github.com_bazelbuild_remote-apis//build/bazel/remote/asset/v1",
        "///third_party/go/github.com_bazelbuild_remote-apis//build/bazel/remote/execution/v2",
        "///third_party/go/github.com_bazelbuild_remote-apis//build/bazel/semver",
        "///third_party/go/github.com_google_uuid//:uuid",
        "///third_party/go/github.com_grpc-ecosystem_go-grpc-middleware//retry",
        "///third_party/go/github.com_grpc-ecosystem_go-grpc-prometheus//:go-grpc-prometheus",
        "///third_party/go/golang.org_x_sync//errgroup",
        "///third_party/go/google.golang.org_genproto_googleapis_rpc//status",
        "///third_party/go/google.golang.org_grpc//:grpc",
        "///third_party/go/google.golang.org_grpc//codes",
        "///third_party/go/google.golang.org_grpc//credentials",
        "///third_party/go/google.golang.org_grpc//credentials/insecure",
        "///third_party/go/google.golang.org_grpc//grpclog",
        "///third_party/go/google.golang.org_grpc//metadata",
        "///third_party/go/google.golang.org_grpc//stats",
        "///third_party/go/google.golang.org_grpc//status",
        "///third_party/go/google.golang.org_protobuf//proto",
        "///third_party/go/google.golang.org_protobuf//types/known/durationpb",
        "//src/build",
        "//src/cli/logging",
        "//src/core",
        "//src/fs",
        "//src/metrics",
        "//src/process",
        "//src/remote/fs",
        "//src/remote/fs/cache",
        "//src/version",
    ],
)

go_test(
    name = "remote_test",
    srcs = [
        "impl_test.go",
        "remote_test.go",
    ],
    data = ["test_data"],
    # TODO(#1412): find out why this flakes on circle
    flaky = True,
    deps = [
        ":remote",
        "///third_party/go/cloud.google.com_go_longrunning//autogen/longrunningpb",
        "///third_party/go/github.com_bazelbuild_remote-apis-sdks//go/pkg/digest",
        "///third_party/go/github.com_bazelbuild_remote-apis//build/bazel/remote/asset/v1",
        "///third_party/go/github.com_bazelbuild_remote-apis//build/bazel/remote/execution/v2",
        "///third_party/go/github.com_bazelbuild_remote-apis//build/bazel/semver",
        "///third_party/go/github.com_peterebden_go-sri//:go-sri",
        "///third_party/go/github.com_stretchr_testify//assert",
        "///third_party/go/github.com_stretchr_testify//require",
        "///third_party/go/google.golang.org_genproto_googleapis_bytestream//:bytestream",
        "///third_party/go/google.golang.org_genproto_googleapis_rpc//status",
        "///third_party/go/google.golang.org_grpc//:grpc",
        "///third_party/go/google.golang.org_grpc//codes",
        "///third_party/go/google.golang.org_grpc//status",
        "///third_party/go/google.golang.org_protobuf//reflect/protoreflect",
        "///third_party/go/google.golang.org_protobuf//types/known/anypb",
        "///third_party/go/google.golang.org_protobuf//types/known/timestamppb",
        "//src/cache",
        "//src/core",
        "//src/fs",
    ],
)
